<!DOCTYPE html>
<?php
	include_once dirname(__FILE__)."/../shared/database.php";
	
	Database::instance();
	
	$result = mysql_query("SELECT COUNT(*) AS total FROM `items`");
	$row = mysql_fetch_assoc($result);
	$total = $row['total'];
	
	$result = mysql_query("SELECT COUNT(*) AS total FROM `items` WHERE verified_match = 1 AND trashed = 0");
	$row = mysql_fetch_assoc($result);
	$verified = $row['total'];
	
	$result = mysql_query("SELECT COUNT(*) AS total FROM `items` WHERE verified_match = 0 AND match_id IS NOT NULL AND trashed = 0");
	$row = mysql_fetch_assoc($result);
	$unverified = $row['total'];
	
	$result = mysql_query("SELECT COUNT(*) AS total FROM `items` WHERE trashed = 1");
	$row = mysql_fetch_assoc($result);
	$trashed = $row['total'];
?>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Alignment Tool Progress</title>
	<meta name="generator" content="TextMate http://macromates.com/">
	<meta name="author" content="Joe Lambert">
	<!-- Date: 2010-11-15 -->
	<link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
	<div id="container">
		<div id="total">
			<?=round((($trashed+$verified)/$total)*100)?><span class="percent">%</span>
		</div>
		<div id="progress">
			<div id="trashed" class="trashed" style="width: <?=round(($trashed/$total)*100)?>%"></div>
			<div id="verified" class="verified" style="width: <?=round(($verified/$total)*100)?>%"></div>
			<div id="unverified" class="unverified" style="width: <?=round(($unverified/$total)*100)?>%"></div>
		</div>
		<div id="values">
			<div>
				<div class="key trashed"></div>
				<div class="title">Trashed</div>
				<div class="percentage"><?=round(($trashed/$total)*100, 2)?>%</div>
			</div>
			<div>
				<div class="key verified"></div>
				<div class="title">Verified</div>
				<div class="percentage"><?=round(($verified/$total)*100, 2)?>%</div>
			</div>
			<div>
				<div class="key unverified"></div>
				<div class="title">Unverified</div>
				<div class="percentage"><?=round(($unverified/$total)*100, 2)?>%</div>
			</div>
		</div>
	</div>
</body>
</html>
